package com.xinqi.controller;

import com.xinqi.utils.RedisIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xin麒
 * @date 2023/2/16 22:18
 */
@RestController
@RequestMapping("hello")
public class HelloController {


    @Autowired
    private RedisIdWorker redisIdWorker;

    @GetMapping("getAnId")
    public String getOnlyIdInRedisIncrement() {

        return Long.toString(redisIdWorker.nextId("order"));

    }

}
